package com.bioroadlab.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.bioroadlab.pojo.TestStatus;

@Repository
public class TestStatusDao extends BaseDao<TestStatus, Integer> {

	@SuppressWarnings("unchecked")
	public List<TestStatus> findAllItems() {
		String hql = "from TestStatus";
		Query query = getSession().createQuery(hql);
		return query.list();
	}

	public TestStatus findtestStatusByName(String name) {
		String hql = "from TestStatus where name=:name";
		Query query = getSession().createQuery(hql);
		query.setParameter("name", name);
		return (TestStatus) query.uniqueResult();
	}

}
